﻿@model ToWaTimeReportMVC4.Models.JobView
@{
    ToWaTimeReportMVC4.Models.ToWaService service = new ToWaTimeReportMVC4.Models.ToWaService();
    ToWaTimeReportMVC4.Models.User user = service.GetUserByUsername(User.Identity.Name);
    if (user != null)
    {
        if (user.Type == 0 || user.Type == 2)
        {

            ViewBag.Title = "Create";


<h2>Create</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="@Url.Content("~/Scripts/jquery-ui-timepicker-addon.js")" type="text/javascript"></script>
<script type="text/javascript">
    $(function () {
        $('#StartTime').datetimepicker();
        $('#EndTime').datetimepicker();
    });
</script>

using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>JobView</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.Description)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Description)
            @Html.ValidationMessageFor(model => model.Description)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.StartTime)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.StartTime, "StartTime", "StartTime")
            @Html.ValidationMessageFor(model => model.StartTime)
        </div>

         <div class="editor-label">
            @Html.LabelFor(model => model.EndTime)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.EndTime, "EndTime", "EndTime")
            @Html.ValidationMessageFor(model => model.EndTime)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ProjectId)
        </div>
        <div class="editor-field">
           <!-- @Html.DropDownList("Pro", Model.Pro)-->
           @Html.DropDownListFor(model => model.SelectedValue, Model.Pro)
            @Html.ValidationMessageFor(model => model.ProjectId)
        </div>

        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
        }
        else
        {
            <p>Permission denied!</p>
        }
    }
}